package com.battery.system.service.impl;

import java.util.List;

import com.battery.common.utils.DateUtils;
import com.battery.system.domain.BO.PointsDetailBO;
import com.battery.system.domain.VO.PointsDetailVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.battery.system.mapper.PointsDetailMapper;
import com.battery.system.domain.PointsDetail;
import com.battery.system.service.IPointsDetailService;
import com.battery.common.core.text.Convert;

/**
 * 积分明细Service业务层处理
 *
 * @author battery
 * @date 2021-02-22
 */
@Service
public class PointsDetailServiceImpl implements IPointsDetailService {
    @Autowired
    private PointsDetailMapper pointsDetailMapper;

    /**
     * 查询积分明细
     *
     * @param id 积分明细ID
     * @return 积分明细
     */
    @Override
    public PointsDetail selectPointsDetailById(String id) {
        return pointsDetailMapper.selectPointsDetailById(id);
    }

    /**
     * 查询积分明细列表
     *
     * @param pointsDetail 积分明细
     * @return 积分明细
     */
    @Override
    public List<PointsDetail> selectPointsDetailList(PointsDetail pointsDetail) {
        return pointsDetailMapper.selectPointsDetailList(pointsDetail);
    }

    /**
     * 新增积分明细
     *
     * @param pointsDetail 积分明细
     * @return 结果
     */
    @Override
    public int insertPointsDetail(PointsDetail pointsDetail) {
        pointsDetail.setCreateTime(DateUtils.getNowDate());
        return pointsDetailMapper.insertPointsDetail(pointsDetail);
    }

    /**
     * 修改积分明细
     *
     * @param pointsDetail 积分明细
     * @return 结果
     */
    @Override
    public int updatePointsDetail(PointsDetail pointsDetail) {
        return pointsDetailMapper.updatePointsDetail(pointsDetail);
    }

    /**
     * 删除积分明细对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deletePointsDetailByIds(String ids) {
        return pointsDetailMapper.deletePointsDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除积分明细信息
     *
     * @param id 积分明细ID
     * @return 结果
     */
    @Override
    public int deletePointsDetailById(String id) {
        return pointsDetailMapper.deletePointsDetailById(id);
    }

    /**
     * @param pointsDetailBO
     * @return
     */
    @Override
    public List<PointsDetailVO> selectPointsDetailVOList(PointsDetailBO pointsDetailBO) {
        return pointsDetailMapper.selectPointsDetailVOList(pointsDetailBO);
    }
}
